<?php

/**
 * This is the model class for table "jumlahnilaiairminum".
 *
 * The followings are the available columns in table 'jumlahnilaiairminum':
 * @property integer $jnam_id
 * @property integer $jnam_tahun
 * @property double $jnam_rumah
 * @property double $jnam_pemerintah
 * @property double $jnam_niaga
 * @property double $jnam_sosial
 * @property double $jnam_kran_umum
 * @property double $jnam_industri
 */
class Jumlahnilaiairminum extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Jumlahnilaiairminum the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'jumlahnilaiairminum';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('jnam_tahun', 'numerical', 'integerOnly'=>true),
			array('jnam_rumah, jnam_pemerintah, jnam_niaga, jnam_sosial, jnam_kran_umum, jnam_industri', 'numerical'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('jnam_id, jnam_tahun, jnam_rumah, jnam_pemerintah, jnam_niaga, jnam_sosial, jnam_kran_umum, jnam_industri', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'jnam_id' => 'Jnam',
			'jnam_tahun' => 'Jnam Tahun',
			'jnam_rumah' => 'Jnam Rumah',
			'jnam_pemerintah' => 'Jnam Pemerintah',
			'jnam_niaga' => 'Jnam Niaga',
			'jnam_sosial' => 'Jnam Sosial',
			'jnam_kran_umum' => 'Jnam Kran Umum',
			'jnam_industri' => 'Jnam Industri',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('jnam_id',$this->jnam_id);
		$criteria->compare('jnam_tahun',$this->jnam_tahun);
		$criteria->compare('jnam_rumah',$this->jnam_rumah);
		$criteria->compare('jnam_pemerintah',$this->jnam_pemerintah);
		$criteria->compare('jnam_niaga',$this->jnam_niaga);
		$criteria->compare('jnam_sosial',$this->jnam_sosial);
		$criteria->compare('jnam_kran_umum',$this->jnam_kran_umum);
		$criteria->compare('jnam_industri',$this->jnam_industri);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}